/* 
 * File:   moveIntf.h
 * Author: cow
 *
 * Created on May 13, 2011, 9:46 AM
 */

#ifndef MOVEINTF_H
#define	MOVEINTF_H

//includes-----------------------------
#include <map>
#include <list>
using namespace std;
//defines------------------------------
namespace infMove{
enum direcion{
	up = 0,
	left,
	right,
	down
};
}
//prototypes---------------------------
namespace infMove{
class mover;
class movemap;
}
//definitions--------------------------
namespace infMove{
//mover++++++++++++
class mover{
public:
	//constructors------
	mover();
	~mover();
	//access------------
	virtual direction gFacing();
	virtual void gPos(int *x, int *y);
	virtual int posX();
	virtual int posY();
	//manips------------
	virtual void move(int x, int Y);
	virtual void place(int x, int y, movemap* m = NULL);
	virtual void face(direction f);
	virtual void setMap(movemap* m);
protected:
	movemap* parent;
	direction facing;
	int posx, posy;
};
//movemap++++++++++
class movemap{
public:
	//constructors------
	movemap();
	~movemap();
	//access------------
	virtual int size();
	virtual mover* get(int x, int y);
	//manip-------------
	virtual mover* move(int x, int y, int nx, int ny);
	virtual mover* add(mover* m);
	virtual mover* remove(mover* m);
protected:
	map<pair<int, int>, mover*> mapping;
};
}

#endif	/* MOVEINTF_H */